const path = require("path");
const FileListPlugin = require("./plugins/FileListPlugin");
const htmlWebpackPlugin = require("html-webpack-plugin");
const testPlugin = require("./plugins/testPlugin");
const fnPlugin = require("./plugins/fnPlugin");

module.exports = {
  entry: "./src/index.js",
  output: {
    filename: "main.js",
    path: path.resolve(__dirname, "dist"),
  },
  mode: "development",
  module: {
    rules: [
      {
        test: /\.js$/,
        use: path.resolve("./loader/testLoader.js"), // 使用你的自定义 loader
      },
    ],
  },
  plugins: [
    new FileListPlugin({ filename: "文件清单.md" }),
    new htmlWebpackPlugin({
      template: "./index.html",
    }),
    new testPlugin(),
    fnPlugin(),
  ],
};
